using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.IO;

public partial class Common_Textbox : System.Web.UI.UserControl
{
    private int mEditorWidth = 900;
    private int mEditorHeight = 300;

    public int EditorWidth
    {
        get { return mEditorWidth; }
        set { mEditorWidth = value; }
    }
    public int EditorHeight
    {

        get { return mEditorHeight; }
        set { mEditorHeight = value; }
    }
    public void IntialText(string text_)
    {
        FreeTextBox1.Text = text_;
    }
    public string RenderText()
    {
        return FreeTextBox1.Text;
    }

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            FreeTextBox1.Width = mEditorWidth;
            FreeTextBox1.Height = mEditorHeight;
            FreeTextBox1.ImageGalleryPath = "~/" + this.GetImageFileLocate();
        }
    }
    private string GetImageFileLocate()
    {
        string sPath = String.Format(Config.IMAGE_NEWS_DEFAULT_UPLOAD, Config.SESSION_USEREMAIL);
        if (!Directory.Exists(Server.MapPath(sPath)))
            Directory.CreateDirectory(Server.MapPath(sPath));
        return sPath;
    }
}
